package com.zdp.degisn.pipe_filter.controller;

import com.zdp.degisn.pipe_filter.FilterPipe;
import com.zdp.degisn.pipe_filter.entity.SickNoteContext;
import com.zdp.degisn.pipe_filter.selector.impl.SickSelectorImpl;
import com.zdp.degisn.pipe_filter.utils.FilterPipeUtils;
import com.zdp.pipe_filter.entity.SickNote;
import com.zdp.degisn.pipe_filter.selector.impl.SickSkipStudentSelectorImpl;

/**
 * @author zhengdp
 * @Description
 * @Date 2022/8/28 18:26
 * @Created by zhengdp
 */
public class SickNoteController {

    // 请假流程
    public SickNoteContext sickNode(){
        SickNote sickNote = new SickNote();
        SickNoteContext sickNoteContext = new SickNoteContext(SickSelectorImpl.instance(),sickNote);
        FilterPipe filterPipe = FilterPipeUtils.instance();
        filterPipe.process(sickNoteContext);
        return sickNoteContext;
    }

    public SickNoteContext skipStudentSickNote(){
        SickNote sickNote = new SickNote();
        SickNoteContext sickNoteContext = new SickNoteContext(SickSkipStudentSelectorImpl.instance(),sickNote);
        FilterPipe filterPipe = FilterPipeUtils.instance();
        filterPipe.process(sickNoteContext);
        return sickNoteContext;
    }



}
